﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using CardPlay.Model.ActionModel;
using CardPlay.Model.CardModel;
using CardPlay.Model.GameModel.Actions;
using CardPlay.Model.GameModel.Presentation;
using CardPlay.Model.Layout;

namespace CardPlay.Model.GameModel
{
    public interface ICardGame : IGame, IObjectWithHost
    {
        event EventHandler ActionExecuted;

        int PercentComplete { get; }

        IPlayingRules Regulations { get; }
        IActionHistory History { get; }

        ObservableCollection<PartLocation> Selection { get; }

        Card CardAt(PartLocation location);
        CardPile PileAt(PartLocation location);

        IEnumerable<CardPile> PilesNamed(string pattern);

        ILayoutSite CreatePresentation(IPresentationContext presentation);

        void Deal(IRandomNumberSequence randomSeries);

        bool IsActionPossibleAt(PartLocation location);
        RemovePileAction CreatePickupActionAt(PartLocation location);

        void Execute(IAction action);
        bool ExecuteCommandAt(PartLocation location, bool auto);

        PeekCardAction CreatePeekAction(PartLocation location);
        MovePileAction CreateMovePileAction(RemovePileAction removeAction, PartLocation moveTo);
    }
}